package com.kx.yooli.kx.wechat.entity.nplm;

import com.kx.yooli.kx.wechat.utils.valid.ValidateCodeUtil;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;

import java.math.BigDecimal;
import java.util.Date;

@Table(value = "NPLM_OVERDUE_CASE",dataSource = "d4")
public class OverdueCase {
    @Id(value = "ID")
    private String id;
    @Column(value = "LOAN_NO")
    private String loanNo;
    @Column(value = "CERT_NO")
    private String certNo;
    @Column(value = "CUST_NAME")
    private String custName;
    @Column(value = "PLANNED_TOTAL")
    private BigDecimal plannedTotal;
    @Column(value = "STATUS")
    private String status;
    @Column(value = "LOAN_AMOUNT")
    private BigDecimal loanAmount;
    @Column(value ="ONCE_SETTLE_AMOUNT")
    private BigDecimal onceSettleAmount;
    @Column(value = "UPDATE_TIME")
    private Date updateTime;
    @Column(value = "REPAY_TIME ")
    private Date repayTime;


    public OverdueCase() {
    }

    public OverdueCase(String id, String loanNo, String certNo, String custName, BigDecimal plannedTotal, String status, BigDecimal loanAmount, BigDecimal onceSettleAmount, Date updateTime, Date repayTime) {
        this.id = id;
        this.loanNo = loanNo;
        this.certNo = certNo;
        this.custName = custName;
        this.plannedTotal = plannedTotal;
        this.status = status;
        this.loanAmount = loanAmount;
        this.onceSettleAmount = onceSettleAmount;
        this.updateTime = updateTime;
        this.repayTime = repayTime;
    }

    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }

    public String getLoanNo() {
        return loanNo;
    }

    public void setLoanNo(String loanNo) {
        this.loanNo = loanNo;
    }

    public String getCertNo() {
        return certNo;
    }

    public void setCertNo(String certNo) {
        this.certNo = certNo;
    }

    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    public BigDecimal getPlannedTotal() {
        return plannedTotal;
    }

    public void setPlannedTotal(BigDecimal plannedTotal) {
        if (plannedTotal.compareTo(new BigDecimal(0)) > 0){
            this.plannedTotal = plannedTotal.add(new BigDecimal(200));
        }else {
            this.plannedTotal = plannedTotal;
        }

    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getLoanAmount() {
        return loanAmount;
    }

    public void setLoanAmount(BigDecimal loanAmount) {
        this.loanAmount = loanAmount;
    }

    @Override
    public String toString() {
        return "OverdueCase{" +
                "id='" + id + '\'' +
                ", loanNo='" + loanNo + '\'' +
                ", certNo='" + certNo + '\'' +
                ", custName='" + custName + '\'' +
                ", plannedTotal=" + plannedTotal +
                ", status='" + status + '\'' +
                ", loanAmount=" + loanAmount +
                '}';
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getRepayTime() {
        return repayTime;
    }

    public void setRepayTime(Date repayTime) {
        this.repayTime = repayTime;
    }

    public BigDecimal getOnceSettleAmount() {
        return onceSettleAmount;
    }

    public void setOnceSettleAmount(BigDecimal onceSettleAmount) {
        this.onceSettleAmount = onceSettleAmount;
    }
}
